
package com.jf.cloud.multishop.feign;

import com.jf.cloud.api.multishop.feign.ShopRefundAddrFeignClient;
import com.jf.cloud.api.multishop.vo.ShopRefundAddrVO;
import com.jf.cloud.common.response.ServerResponseEntity;
import com.jf.cloud.common.security.AuthUserContext;
import com.jf.cloud.multishop.service.ShopRefundAddrService;
import ma.glasnost.orika.MapperFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zz
 * @date 2020/11/23
 */
@RestController
public class ShopRefundAddrController implements ShopRefundAddrFeignClient {

    @Autowired
    private ShopRefundAddrService shopRefundAddrService;
    @Autowired
    private MapperFacade mapperFacade;

    @Override
    public ServerResponseEntity<ShopRefundAddrVO> getShopRefundAddrByRefundAddrId(Long refundAddrId) {
        Long shopId = AuthUserContext.get().getTenantId();
        ShopRefundAddrVO shopRefundAddr = shopRefundAddrService.getByShopRefundAddrId(refundAddrId,shopId);
        return ServerResponseEntity.success(shopRefundAddr);
    }
}
